{extend name="public/common"}

{block name="style"}
<title>点对点教育VIP学员_私人定制</title>
<link rel="stylesheet" href="__HOME__/css/mui/mui.min.css">
<link rel="stylesheet" href="__HOME__/css/test/school.css">
<style>
    .top {
        width: 100%;
        font-size: 32px;
        color: #64a052;
        text-align: center;
    }
    p {
        font-size: 1.8rem;
        margin-top: 0;
        margin-bottom: 10px;
        color: #8f8f94;
    }
    .top img {
        width: 120px;
        margin-top: 2px;
        text-align: left;
        margin-left: -60vw;
    }
    .save{
        margin-top:5vw;
    }
    .sweet-alert h2 {
        color: #847d7d8f;
        font-size: 27px;
    }
    .list{
       margin-top: 16vw;
    }
    .list ul li {
        border-bottom: 1px solid #f1f1f1;
        font-size: 1.8rem;
        padding: 5vw 1.2vw 2vw 1.2vw;
        overflow: hidden;
        vertical-align: middle;
    }
    .mui-table-view-cell>a:not(.mui-btn) {
        font-size: 1.6rem;
        margin: 2vw;
        text-align: center;
        white-space: pre-wrap;
    }
    .mui-popover .mui-table-view{
        text-align: center;
    }
    #popover2 {
        height: 180px;
    }
    #popover8 {
        height: 300px;
    }
    #popover9 {
        height: 300px;
    }
    #popover10 {
        height: 300px;
    }
    #popover11 {
        height: 300px;
    }
    #openPopover2 {
        color: #333;
        width: 65%;
        float: right;
        text-align: left;
    }
    #openPopover8 {
        color: #333;
        width: 55%;
        float: right;
        text-align: left;
    }
    #openPopover9 {
        color: #333;
        width: 100%;
        float: right;
        text-align: center;
        white-space: nowrap;
        overflow:hidden;
        text-overflow: ellipsis;
    }
    #openPopover10 {
        color: #333;
        width: 100%;
        float: right;
        text-align: center;
        white-space: nowrap;
        overflow:hidden;
        text-overflow: ellipsis;
    }
    #openPopover11 {
        color: #333;
        width: 100%;
        float: right;
        text-align: center;
        white-space: nowrap;
        overflow:hidden;
        text-overflow: ellipsis;
    }
    .list ul li input[type="text"],input[type="number"] {
        border: none;
        margin-bottom: 0;
        width: 65%;
        text-align: left;
        right: 0;
        padding: 0;
        -webkit-user-select: text;
        -user-select: text;
    }
    .mui-table-view-cell {
        position: relative;
        overflow: hidden;
        padding: 1px 15px;
        -webkit-touch-callout: none;
    }
    .img{
        width: 6vw;
        height: 6vw;
    }
    .save{
        width: 25vw;
        background: #64a052;
        border-radius: 5px;
        color: #fff;
        border: 1px solid #64a052;
        text-align: center;
        font-size: 2rem;
        box-shadow: 0 0 1.6vw #64a052;
        margin-top: 30vw;
        margin-bottom: 5vw;
    }
    .gore{
        width: 54vw;
        border-radius: 5px;
        margin: 2vw auto;
        text-align: center;
        font-size: 1.4rem;
        color: #ec7f6a;
        background-color: #fff;
    }
    .gores{
        width: 54vw;
        border-radius: 5px;
        margin: 2vw auto;
        text-align: center;
        font-size: 1.4rem;
        color: #ec7f6a;
        background-color: #fff;
    }
</style>
{/block}

{block name="body"}
<div class="top">
    <img src="__ADMIN__/images/logo.png">
    <div style="margin-top: 8vw">私 人 定 制</div>
</div>
<div class="main">
    <div class="list">
        <ul>
            <li class="type1 address">
                <span><img src="__HOME__/images/check/tip.png" class="img"> </span>年份：
                <a id="openPopover2" href="#popover2" data-id=""></a>
            </li>
            <li class="type1 address">
                <span><img src="__HOME__/images/check/tip.png" class="img"> </span>地区 / 院校：
                <a id="openPopover8" href="#popover8" data-id=""></a>
            </li>
            <li class="type1 address">
                <a id="openPopover9" href="#popover9" data-id=""></a>
            </li>
            <!--<li class="type1 address">-->
                <!--<a id="openPopover10" href="#popover10" data-id="电子信息学院"><p>电子信息学院</p></a>-->
            <!--</li>-->
            <!--<li class="type1 address">-->
                <!--<a id="openPopover11" href="#popover11" data-id="3465"><p>集成电路设计与集成系统</p></a>-->
            <!--</li>-->
        </ul>
    </div>
    <div class="save">查&emsp;询</div>
    {neq name="$sc" value="0"}
    <a href="/DDDeducation/public/index.php/home/Check/info/time/{$nf}/school/{$sc}" class="gore" style="display: block;color: #64a052;text-decoration: underline">我的 私人定制 </a>
    {else/}
    <div class="gores" style="display: block;color: #cccccc;text-decoration: line-through">我的 私人定制</div>
    {/neq}
</div>
<div id="popover2" class="mui-popover" >
    <div class="mui-scroll-wrapper">
        <div class="mui-scroll">
            <ul class="mui-table-view">
                {volist name="year" id="de"}
                <li class="mui-table-view-cell" data-id="{$de}" data-tab="{$i}"><a>{$de}</a></li>
                {/volist}
            </ul>
        </div>
    </div>
</div>
<div id="popover8" class="mui-popover" >
    <div class="mui-scroll-wrapper">
        <div class="mui-scroll">
            <ul class="mui-table-view">
                {volist name="area" id="ar"}
                <li class="mui-table-view-cell" data-id="{$ar.dq_id}" data-tab="{$i}"><a>{$ar.dq}</a></li>
                {/volist}
            </ul>
        </div>
    </div>
</div>
<div id="popover9" class="mui-popover" >
    <div class="mui-scroll-wrapper">
        <div class="mui-scroll">
            <ul class="mui-table-view">
                {volist name="school" id="sch"}
                <li class="mui-table-view-cell" data-id="{$sch.dx_id}" data-tab="{$i}"><a>{$sch.dx}</a></li>
                {/volist}
            </ul>
        </div>
    </div>
</div>
<div id="popover10" class="mui-popover" >
    <div class="mui-scroll-wrapper">
        <div class="mui-scroll">
            <ul class="mui-table-view">
                {volist name="home" id="h"}
                <li class="mui-table-view-cell" data-id="{$h.xy}" data-tab="{$i}"><a>{$h.xy}</a></li>
                {/volist}
            </ul>
        </div>
    </div>
</div>
<div id="popover11" class="mui-popover" >
    <div class="mui-scroll-wrapper">
        <div class="mui-scroll">
            <ul class="mui-table-view">
                {volist name="zy" id="z"}
                <li class="mui-table-view-cell" data-id="{$z.id}" data-tab="{$i}"><a>{$z.zy}</a></li>
                {/volist}
            </ul>
        </div>
    </div>
</div>
{/block}

{block name="script"}
<script src="__HOME__/js/reset.js"></script>
<script src="__HOME__/js/mui.min.js"></script>
<script src="__HOME__/js/mui.picker.min.js"></script>
<script src="__HOME__/js/jquery-1.12.1.min.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script>
    $('title' ).text('点对点教育VIP学员_私人定制');
    mui('.mui-scroll-wrapper').scroll();
    //模块标题
    //关闭分享
    function onBridgeReady() {
        WeixinJSBridge.call('hideOptionMenu');
    }
    if (typeof WeixinJSBridge == "undefined") {
        if (document.addEventListener) {
            document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
        } else if (document.attachEvent) {
            document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
            document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
        }
    } else {
        onBridgeReady();
    }
    var dq = "浙江";
    var dq_id = 12;
    var xx = "杭州电子科技大学";
    var xx_id = 439;
    var nf = "{$nf}";
    if (sessionStorage.getItem("dq") !="" && sessionStorage.getItem("dq") !=null){
        dq =sessionStorage.getItem("dq");
        dq_id =sessionStorage.getItem("dq_id");
        xx = sessionStorage.getItem("xx");
        xx_id = sessionStorage.getItem("xx_id");
        nf = sessionStorage.getItem("nf");
    }
    $("#openPopover8").html("<p>"+dq+"</p>");
    $("#openPopover8").attr("data-id",dq_id);
    $("#openPopover9").html("<p>"+xx+"</p>");
    $("#openPopover9").attr("data-id",xx_id);
    $("#openPopover2").html("<p>"+nf+"</p>");
    $("#openPopover2").attr("data-id",nf);
    $("#popover2 ul li").click(function(){
        var select_it = $(this).text();
        $("#openPopover2").html("<p>"+select_it+"</p>");
        var id = $(this).attr("data-id");
        $("#openPopover2").attr("data-id",id);
        mui('#popover2').popover("hide");
    });
    $("#popover8 ul li").click(function(){
        var select_it = $(this).text();
        $("#openPopover8").html("<p>"+select_it+"</p>");
        var id = $(this).attr("data-id");
        $("#openPopover8").attr("data-id",id);
        mui('#popover8').popover("hide");
        $.ajax({
            type:"post",
            url: "{:Url('Check/sele')}",
            data:{id:id},
            beforeSend: function(XMLHttpRequest){
                $("#openPopover9").html("<p>请选择学校</p>");
                $("#openPopover9").attr("data-id",'');
                $("#popover9 .mui-scroll ul li").each(function(){
                    $(this).remove();
                });
//                $("#openPopover10").html('请选择学院');
//                $("#openPopover10").attr("data-id",'');
//                $("#popover10 .mui-scroll ul li").each(function(){
//                    $(this).remove();
//                });
//                $("#openPopover11").html('请选择专业');
//                $("#openPopover11").attr("data-id",'');
//                $("#popover11 .mui-scroll ul li").each(function(){
//                    $(this).remove();
//                });
            },
            success:function(data){
                var html = '';
                var len = data.length;
                for(var i = 0; i< len;i++){
                    var list = data[i];
                    html+='<li class="mui-table-view-cell" data-id="'+list.dx_id+'" data-tab="'+i+'"><a>'+list.dx+'</a></li>';
                }
                $("#popover9 ul" ).append(html);
                $("#popover9 ul li").click(function(){
                    var select_it1 = $(this).text();
                    $("#openPopover9").html("<p>"+select_it1+"</p>");
                    var id1 = $(this).attr("data-id");
                    $("#openPopover9").attr("data-id",id1);
                    mui('#popover9').popover("hide");
//                    $.ajax({
//                        type:"post",
//                        url: "{:Url('Check/selec')}",
//                        data:{id:id1},
//                        beforeSend: function(XMLHttpRequest){
//                            $("#openPopover10").html('请选择学院');
//                            $("#openPopover10").attr("data-id",'');
//                            $("#popover10 .mui-scroll ul li").each(function(){
//                                $(this).remove();
//                            });
//                            $("#openPopover11").html('请选择专业');
//                            $("#openPopover11").attr("data-id",'');
//                            $("#popover11 .mui-scroll ul li").each(function(){
//                                $(this).remove();
//                            });
//                        },
//                        success:function(data){
//                            var html = '';
//                            var len = data.length;
//                            for(var i = 0; i< len;i++){
//                                var list = data[i];
//                                html+='<li class="mui-table-view-cell" data-id="'+list.xy+'" data-tab="'+i+'"><a>'+list.xy+'</a></li>';
//                            }
//                            $("#popover10 ul" ).append(html);
//                            $("#popover10 ul li").click(function(){
//                                var select_it2 = $(this).text();
//                                $("#openPopover10").html(select_it2);
//                                var id2 = $(this).attr("data-id");
//                                $("#openPopover10").attr("data-id",id2);
//                                mui('#popover10').popover("hide");
//                                $.ajax({
//                                    type:"post",
//                                    url: "{:Url('Check/select')}",
//                                    data:{id:id1,name:select_it2},
//                                    beforeSend: function(XMLHttpRequest){
//                                        $("#openPopover11").html('请选择专业');
//                                        $("#openPopover11").attr("data-id",'');
//                                        $("#popover11 .mui-scroll ul li").each(function(){
//                                            $(this).remove();
//                                        });
//                                    },
//                                    success:function(data){
//                                        var html = '';
//                                        var len = data.length;
//                                        for(var i = 0; i< len;i++){
//                                            var list = data[i];
//                                            html+='<li class="mui-table-view-cell" data-id="'+list.id+'" data-tab="'+i+'"><a>'+list.zy+'</a></li>';
//                                        }
//                                        $("#popover11 ul" ).append(html);
//                                        $("#popover11 ul li").click(function(){
//                                            var select_it3 = $(this).text();
//                                            $("#openPopover11").html(select_it3);
//                                            var id3 = $(this).attr("data-id");
//                                            $("#openPopover11").attr("data-id",id3);
//                                            mui('#popover11').popover("hide");
//                                        });
//                                    }
//                                });
//                            });
//                        }
//                    });
                });
            }
        });
    });
    $("#popover9 ul li").click(function(){
        var select_it = $(this).text();
        $("#openPopover9").html("<p>"+select_it+"</p>");
        var id = $(this).attr("data-id");
        $("#openPopover9").attr("data-id",id);
        mui('#popover9').popover("hide");
//        $.ajax({
//            type:"post",
//            url: "{:Url('Check/selec')}",
//            data:{id:id},
//            beforeSend: function(XMLHttpRequest){
//                $("#openPopover10").html('请选择学院');
//                $("#openPopover10").attr("data-id",'');
//                $("#popover10 .mui-scroll ul li").each(function(){
//                    $(this).remove();
//                });
//                $("#openPopover11").html('请选择专业');
//                $("#openPopover11").attr("data-id",'');
//                $("#popover11 .mui-scroll ul li").each(function(){
//                    $(this).remove();
//                });
//            },
//            success:function(data){
//                var html = '';
//                var len = data.length;
//                for(var i = 0; i< len;i++){
//                    var list = data[i];
//                    html+='<li class="mui-table-view-cell" data-id="'+list.xy+'" data-tab="'+i+'"><a>'+list.xy+'</a></li>';
//                }
//                $("#popover10 ul" ).append(html);
//                $("#popover10 ul li").click(function(){
//                    var select_it1 = $(this).text();
//                    $("#openPopover10").html(select_it1);
//                    var id1 = $(this).attr("data-id");
//                    $("#openPopover10").attr("data-id",id1);
//                    mui('#popover10').popover("hide");
//                    $.ajax({
//                        type:"post",
//                        url: "{:Url('Check/select')}",
//                        data:{id:id,name:select_it1},
//                        beforeSend: function(XMLHttpRequest){
//                            $("#openPopover11").html('请选择专业');
//                            $("#openPopover11").attr("data-id",'');
//                            $("#popover11 .mui-scroll ul li").each(function(){
//                                $(this).remove();
//                            });
//                        },
//                        success:function(data){
//                            var html = '';
//                            var len = data.length;
//                            for(var i = 0; i< len;i++){
//                                var list = data[i];
//                                html+='<li class="mui-table-view-cell" data-id="'+list.id+'" data-tab="'+i+'"><a>'+list.zy+'</a></li>';
//                            }
//                            $("#popover11 ul" ).append(html);
//                            $("#popover11 ul li").click(function(){
//                                var select_it = $(this).text();
//                                $("#openPopover11").html(select_it);
//                                var id = $(this).attr("data-id");
//                                $("#openPopover11").attr("data-id",id);
//                                mui('#popover11').popover("hide");
//                            });
//                        }
//                    });
//                });
//            }
//        });
    });
//    $("#popover10 ul li").click(function(){
//        var select_it = $(this).text();
//        $("#openPopover10").html(select_it);
//        var name = $(this).attr("data-id");
//        var id = $("#openPopover9").attr("data-id");
//        $("#openPopover10").attr("data-id",id);
//        mui('#popover10').popover("hide");
//        $.ajax({
//            type:"post",
//            url: "{:Url('Check/select')}",
//            data:{id:id,name:name},
//            beforeSend: function(XMLHttpRequest){
//                $("#openPopover11").html('请选择专业');
//                $("#openPopover11").attr("data-id",'');
//                $("#popover11 .mui-scroll ul li").each(function(){
//                    $(this).remove();
//                });
//            },
//            success:function(data){
//                var html = '';
//                var len = data.length;
//                for(var i = 0; i< len;i++){
//                    var list = data[i];
//                    html+='<li class="mui-table-view-cell" data-id="'+list.id+'" data-tab="'+i+'"><a>'+list.zy+'</a></li>';
//                }
//                $("#popover11 ul" ).append(html);
//                $("#popover11 ul li").click(function(){
//                    var select_it = $(this).text();
//                    $("#openPopover11").html(select_it);
//                    var id = $(this).attr("data-id");
//                    $("#openPopover11").attr("data-id",id);
//                    mui('#popover11').popover("hide");
//                });
//            }
//        });
//    });
//    $("#popover11 ul li").click(function(){
//        var select_it = $(this).text();
//        $("#openPopover11").html(select_it);
//        var id = $(this).attr("data-id");
//        $("#openPopover11").attr("data-id",id);
//        mui('#popover11').popover("hide");
//    });
    options = {
        scrollY: true, //是否竖向滚动
        scrollX: false, //是否横向滚动
        startX: 0, //初始化时滚动至x
        startY: 0, //初始化时滚动至y
        indicators: false, //是否显示滚动条
        deceleration:0.0006, //阻尼系数,系数越小滑动越灵敏
        bounce: true //是否启用回弹
    };

    mui('.mui-scroll-wrapper').scroll({
        deceleration: 0.0005 //flick 减速系数，系数越大，滚动速度越慢，滚动距离越小，默认值0.0006
    });
    $(".save").on("click",function(){
        var time = $("#openPopover2").text();
        var school = $("#openPopover9").attr('data-id');
        if (time == ''){
            swal({
                title: ' ',
                text: '请选择年份',
                type: 'error',
                showConfirmButton:false,
                timer:1500
            });
            return false;
        }
        if (school == ''){
            swal({
                title: ' ',
                text: '请选择院校',
                type: 'error',
                showConfirmButton:false,
                timer:1500
            });
            return false;
        }
        sessionStorage.setItem("dq",$("#openPopover8").text());
        sessionStorage.setItem("dq_id",$("#openPopover8").attr('data-id'));
        sessionStorage.setItem("xx",$("#openPopover9").text());
        sessionStorage.setItem("xx_id",$("#openPopover9").attr('data-id'));
        sessionStorage.setItem("nf",time);
        window.location.href="/DDDeducation/public/index.php/home/Check/info/time/"+time+"/school/"+school;
    })
</script>
{/block}